package com.uflower.user.controller;

import com.uflower.common.utils.R;
import com.uflower.user.entity.ReceiveAddressEntity;
import com.uflower.user.service.ReceiveAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class PageController {
    @Autowired
    ReceiveAddressService receiveAddressService;
    @RequestMapping("user/receiveaddress/saveAddress")
    //@RequiresPermissions("user:receiv eaddress:save")
    public String save(@RequestParam("uid") Long uid,
                  @RequestParam("name") String name,
                  @RequestParam("phone") String phone,
                  @RequestParam("province") String province,
                  @RequestParam("city") String city,
                  @RequestParam("region") String region,
                  @RequestParam("detailAddress") String detailAddress) {
        receiveAddressService.save(uid, name, phone, phone, city, region, detailAddress);

        return "redirect:http://localhost:88/api/order/order/toTrade";
    }

}
